package org.goyo.main.domain.entity.base;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;

import org.goyo.main.domain.entity.BaseEntryObject;
import org.goyo.main.domain.entity.base.Material;
/**
 * 采购订单分录
 * 
 * @author chenchuan
 * 2014年11月12日
 */
@Entity
public class MaterialEntry extends BaseEntryObject implements Serializable {

    private static final long serialVersionUID = 1L;
    
    @ManyToOne
    @JoinColumn(name="baseUnitMeasureID")
    private BaseUnitMeasure baseUnitMeasure;
    
    /**
     * 换算率
     */
    @Column
    private String conversionRate;

    public BaseUnitMeasure getBaseUnitMeasure() {
      return baseUnitMeasure;
    }

    public void setBaseUnitMeasure(BaseUnitMeasure baseUnitMeasure) {
      if(baseUnitMeasure != null &&("".equals(baseUnitMeasure.getUuid()) || baseUnitMeasure.getUuid()==null))
        this.baseUnitMeasure = null;
    else
        this.baseUnitMeasure = baseUnitMeasure;
    }

    public String getConversionRate() {
      return conversionRate;
    }

    public void setConversionRate(String conversionRate) {
      this.conversionRate = conversionRate;
    }


   
}
